<template>
  <div class="app-container">
    <el-table border :data="detailList" style="width: 100%">
      <el-table-column label="编号" width="100" type="index" align="center" fixed="left"
                       :index="index=>index+1"/>

      <el-table-column prop="resourceName" label="食材名称" align="center" />
      <el-table-column prop="amount" label="报损数量" align="center">
<!--        <template #default="{row}">-->
<!--          <span v-if="row.amount>=0">{{row.amount}}</span>-->
<!--        </template>-->
      </el-table-column>
      <el-table-column prop="unit" label="单位" align="center" />
<!--      <el-table-column prop="price" label="单价" align="center" >-->
<!--      </el-table-column>-->
    </el-table>
  </div>
</template>

<script>
import {overflowDetailList} from "@/api/store/calculate/calculate";
export default {
  name: "BaseDetail",
  dicts: ['sys_normal_disable'],
  data() {
    return {
      baseUrl: process.env.VUE_APP_BASE_API,
      id: undefined,
      detailList: [],
    };
  },
  created() {
    this.id = this.$route.query && this.$route.query.businessNum;
    this.getList();
  },
  methods: {
    /** 查询列表 */
    getList() {
      overflowDetailList({businessNum: this.id,}).then(response => {
        this.detailList = response.rows;
      });
    },
  }
};
</script>
